package com.liu.servlet;

import java.net.Socket;

/**
 * @author LIU
 * @version 1.0
 * @description TODO
 * @date 2024/2/6 10:06
 */
public class Request extends AbstractHttpServletRequest{
    private String method;
    private String uri;
    private String protocol;


    private Socket socket;

    public Request(String method, String uri, String protocol, Socket socket) {
        this.method = method;
        this.uri = uri;
        this.protocol = protocol;
        this.socket = socket;
    }

    @Override
    public String getMethod() {
        return method;
    }

    @Override
    public String getRequestURI() {
        return uri;
    }

    @Override
    public String getProtocol() {
        return protocol;
    }


    public Socket getSocket() {
        return socket;
    }

    @Override
    public String toString() {
        return "Request{" +
                "method='" + method + '\'' +
                ", uri='" + uri + '\'' +
                ", protocol='" + protocol + '\'' +
                ", socket=" + socket +
                "} " + super.toString();
    }
}
